package home.study.xxy.bs.controller;

import home.study.xxy.bs.entity.Bill;
import home.study.xxy.bs.entity.Chat;
import home.study.xxy.bs.entity.Page;
import home.study.xxy.bs.entity.ResultList;
import home.study.xxy.bs.mapper.ChatMapper;
import home.study.xxy.bs.service.BillService;
import home.study.xxy.bs.service.ChatService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @title: BillController
 * @功能:
 * @Author Xiao Xiangyu
 * @Date: 2021/4/23 21:18
 * @Version 1.0
 */

@Slf4j
@RestController
@RequestMapping("/chatController")
public class ChatController {
    @Autowired
    private ChatService chatService;

    /**
     * 查询所有通知
     * @param userId
     * @return
     */
    @GetMapping("/queryAllById")
    public List<Chat> queryChatById(String userId){
        List<Chat> chats = chatService.queryChatById(userId);
        if (chats!=null&&chats.size()>0){
            return chatService.queryChatById(userId);
        }else{
            return null;
        }
    }
}
